package com.yt.common.exception;

import com.yt.common.enums.CodeEnum;

public class BusinessException extends RuntimeException {
    private int code;

    public BusinessException(CodeEnum codeEnum) {
        super(codeEnum.getMsg());
        this.code = codeEnum.getCode();
    }

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    // getter/setter
    public int getCode() {
        return code;
    }
}